import Request from '@/utils/request.js'

// 添加题目
export const AddQuestion = (questionData) => {
    return Request.post("/question/add", questionData);
}

// 删除题目
export const DeleteQuestion = (questionId) => {
    return Request.delete(`/question/delete?id=${questionId}`);
};
// 更新题目
export const UpdateQuestion = (questionData) => {
    return Request.put("/question/update", questionData);
}

// 获取题目信息（VO版本）
export const GetQuestionVOById = (questionId) => {
    return Request.get(`/question/get/vo?id=${questionId}`);
}

// 分页获取题目列表
export const ListQuestionsByPage = (queryParams) => {
    return Request.post("/question/list/page", queryParams, );
}

// 分页获取题目列表（封装类）
export const ListQuestionVOByPage = (queryParams) => {
    return Request.post("/question/list/page/vo", queryParams, {
        headers: {
            'Content-Type': 'application/json'
        }
    });
}

// 分页获取当前用户创建的题目列表
export const ListMyQuestionsByPage = (queryParams) => {
    return Request.post("/question/my/list/page/vo",queryParams,{
        headers: {
            'Content-Type': 'application/json'
        }
    });
}

// 编辑题目
export const EditQuestion = (editData) => {
    return Request.post("/question/edit", editData);
}

// AI生成题目
export const AIGenerateQuestion = (generateData) => {
    return Request.post("/question/AI/add", generateData);
}